package com.yjj.properties;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@Component("iPProperties")//自定义bean的名称
@ConfigurationProperties(prefix = "tools.ip")
public class IPProperties {

    /**
     * 显示频率 默认5秒
     */
    private long cycle=5L;

    /**
     * 显示模式 默认simple 详细模式detail
     */
    private String model=Model.SIMPLE.value;

    public enum Model{
        SIMPLE("simple"),
        DETAIL("detail");
        String value;
        Model(String value){
            this.value=value;
        }

        public String getValue() {
            return value;
        }
    }

    public long getCycle() {
        return cycle;
    }

    public void setCycle(long cycle) {
        this.cycle = cycle;
    }

    public String getModel() {
        return model;
    }

    public void setModel(String model) {
        this.model = model;
    }
}
